package bank;

import java.io.Serializable;

public class Card implements Serializable{
	private int cardId;
	private String name;
	private double money;
	// 删除标记,true是被删除的，false没被删除的
	private boolean deleteFlag;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + cardId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Card other = (Card) obj;
		if (cardId != other.cardId)
			return false;
		return true;
	}
	public Card() {
		super();
	}
	public Card(int cardId, String name, double money, boolean deleteFlag) {
		super();
		this.cardId = cardId;
		this.name = name;
		this.money = money;
		this.deleteFlag = deleteFlag;
	}
	public int getCardId() {
		return cardId;
	}
	public void setCardId(int cardId) {
		this.cardId = cardId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getMoney() {
		return money;
	}
	public void setMoney(double money) {
		this.money = money;
	}
	public boolean isDeleteFlag() {
		return deleteFlag;
	}
	public void setDeleteFlag(boolean deleteFlag) {
		this.deleteFlag = deleteFlag;
	}
	
	@Override
	public String toString() {
		return "Card [cardId=" + cardId + ", name=" + name + ", money=" + money + ", deleteFlag=" + deleteFlag + "]";
	}
}
